<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        console.dir(Object);

        var obj1={a:1,b:2},obj2={b:3,c:4};

        //使用obj2扩展obj1，如果存在就覆盖，如果不存在就添加
        var obj3=Object.assign(obj1,obj2);
        console.log(obj1);  //{a:1,b:3,c:4}
        console.log(obj2);  //{b:3,c:4}
        console.log(obj3);  //{a:1,b:3,c:4}
    </script>
</body>
</html>